package com.kingwang.demo.springsecuritytokendemo.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@PreAuthorize("hasRole('user')")
@RestController
public class HelloController {
    @GetMapping("/api/hello")
    public String sayHello() {
        return "Hello";
    }

    @GetMapping("/")
    public String index() {
        return "index";
    }
}
